package com.technology.education.dslitem

import android.widget.TextView
import com.angcyo.dsladapter.DslAdapterStatusItem
import com.angcyo.dsladapter.DslViewHolder
import com.technology.education.R

/**
 *@author:create by BZY
 *Date: 2020/6/1 11
 */
class AppStatusItem (var layoutId:Int=0): DslAdapterStatusItem() {
    init {
        itemStateLayoutMap[ADAPTER_STATUS_EMPTY] =if (layoutId>0) layoutId else R.layout.item_empty
    }
    override fun _onBindStateLayout(itemHolder: DslViewHolder, state: Int) {
        super._onBindStateLayout(itemHolder, state)
        itemSpanCount = -1
        if (state == ADAPTER_STATUS_LOADING) {
            itemHolder.v<TextView>(R.id.text_view)?.text = "数据加载中..."
        }
    }
}